Run Cleaning Script, Read In Clean Data & Set Colour Scheme for
Visualisations
source(here("scripts/cleaning_script.R"))
Attaching package: ‘janitor’
The following objects are masked from ‘package:stats’:
chisq.test, fisher.test
Rows: 2673 Columns: 7── Column specification ───────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (6): FeatureCode, DateCode, Measurement, Units, Region of Residence, Breakdown of Domestic Tourism
dbl (1): Value
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.Rows: 32 Columns: 2── Column specification ───────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (2): feature_code, local_authority
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.Warning: One or more parsing issues, call `problems()` on your data frame for details, e.g.:
dat <- vroom(...)
problems(dat)Rows: 32082 Columns: 11── Column specification ───────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (6): Quarter, Country, Purpose, Mode, Duration, Age
dbl (4): Visits, Nights, Spend, Sample
num (1): Year
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.New names:Rows: 463 Columns: 7── Column specification ───────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (1): Local Authority
dbl (3): Year, Turnover, GVA
num (2): Business Units, Employment
lgl (1): ...7
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Reading layer `pub_las' from data source
`/Users/stuartstenhouse/Codeclan/visit_scotland_codeclan_project/data/geo_data' using driver `ESRI Shapefile'
Simple feature collection with 32 features and 3 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 5512.998 ymin: 530250.8 xmax: 470332 ymax: 1220302
Projected CRS: OSGB36 / British National Grid
Rows: 11 Columns: 4── Column specification ───────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
dbl (1): year
num (3): visits, spend, nights
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.Warning: Each row in `x` is expected to match at most 1 row in `y`.Warning: Each row in `x` is expected to match at most 1 row in `y`.Warning: object 'dom_int_summary_clean' not found
regional_domestic_tourism_individual <- read_csv(here("data/clean_data/regional_domestic_tourism_individual_clean.csv"))
Rows: 288 Columns: 7── Column specification ───────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (4): feature_code, year, region_of_residence, local_authority
dbl (3): visits, nights, expenditure
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
regional_domestic_tourism_non_gb_clean <- read_csv(here("data/clean_data/regional_domestic_tourism_non_gb_clean.csv"))
Rows: 576 Columns: 7── Column specification ───────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (4): feature_code, year, region_of_residence, local_authority
dbl (3): visits, expenditure, nights
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
international_visits <- read_csv(here("data/clean_data/international_visits_clean.csv"))
Rows: 32082 Columns: 11── Column specification ───────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (6): quarter, country, purpose, mode, duration, age
dbl (5): year, visits, nights, spend, sample
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
tourism_businesses <- read_csv(here("data/clean_data/tourism_businesses_clean.csv"))
Rows: 462 Columns: 6── Column specification ───────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (1): local_authority
dbl (5): year, business_units, employment, turnover, gva
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
dom_int_summary <- read_csv(here("data/clean_data/dom_int_summary_clean.csv"))
Rows: 22 Columns: 4── Column specification ───────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (1): dom_int
dbl (3): year, visits, spend
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
local_authority_geo <- st_read(dsn = "data/geo_data/", layer = "pub_las")
Reading layer `pub_las' from data source
`/Users/stuartstenhouse/Codeclan/visit_scotland_codeclan_project/data/geo_data' using driver `ESRI Shapefile'
Simple feature collection with 32 features and 3 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 5512.998 ymin: 530250.8 xmax: 470332 ymax: 1220302
Projected CRS: OSGB36 / British National Grid
colour_scheme <- c("#540453", "#1d1d65", "#970061", "#b6cb2b", "#9fd6f3")